##############################################################
## MOD Title: Full Album Pack Pictures Blocks
## MOD Author: Mighty Gorgon < mightygorgon@mightygorgon.com > (Luca Libralato) http://www.mightygorgon.com/
## MOD Description: This MOD adds a block of recent, random, most viewed, or most rated pictures, anywhere on your phpBB.
## 
## MOD Version: 1.0.0
## 
## Installation Level: Easy
## Installation Time: 5 minutes
## Files To Edit: (2)
##                anypage.php
##                templates/subSilver/anypage.tpl
##                
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
## 
## This mod requires FAP 1.2.0
## 
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################
#
#-----[ OPEN ]------------------------------------------------
#
anypage.php
#
#-----[ FIND ]------------------------------------------------
#
$template->pparse('body');
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
// Mighty Gorgon - Picture Blocks - BEGIN
$phpbb_root_path = './';
$album_root_path = $phpbb_root_path . 'album_mod/';
include($album_root_path . 'album_common.' . $phpEx);

//$album_config['img_cols'] = 4;
$cols = ($album_config['img_cols'] == 0 ? 4 : $album_config['img_cols']);
$cols_width = (100/$cols) . '%';

$catrows = array ();
$options = ALBUM_AUTH_VIEW;
$catrows = album_read_tree($album_user_id, $options);
$allowed_cat = ''; // For Recent Public Pics below
for ($i = 0; $i < count($catrows); $i ++)
{
	$allowed_cat .= ($allowed_cat == '') ? $catrows[$i]['cat_id'] : ',' . $catrows[$i]['cat_id'];
}

album_build_recent_pics($allowed_cat);
album_build_highest_rated_pics($allowed_cat);
album_build_most_viewed_pics($allowed_cat);
album_build_random_pics($allowed_cat);

$template->assign_vars(array(
	'S_COLS' => $cols,
	'S_COL_WIDTH' => $cols_width,
	'TARGET_BLANK' => ($album_config['fullpic_popup']) ? 'target="_blank"' : '',
	'L_RAND_PICS' => $lang['Random_Pictures'],
	'L_HI_RATINGS' => $lang['Highest_Rated_Pictures'],
	'L_RECENT_PUBLIC_PICS' => $lang['Recent_Public_Pics'],
	'L_MOST_VIEWED' => $lang['Most_Viewed_Pictures'],
	'L_NO_PICS' => $lang['No_Pics'],
	'L_PIC_TITLE' => $lang['Pic_Image'],
	'L_PIC_ID' => $lang['Pic_ID'],
	'L_VIEW' => $lang['View'],
	'L_POSTER' => $lang['Pic_Poster'],
	'L_POSTED' => $lang['Posted']
	)
);
// Mighty Gorgon - Picture Blocks - END
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/anypage.tpl
#
#-----[ ADD ]-------------------------------------------------
#
<!-- BEGIN recent_pics_block -->
<table class="forumline" width="98%" align="center" cellspacing="1" cellpadding="2">
	<tr><th class="thTop" height="25" colspan="{S_COLS}" nowrap="nowrap">{L_RECENT_PUBLIC_PICS}</th></tr>
	<!-- BEGIN no_pics -->
	<tr><td class="row1" align="center" colspan="{S_COLS}" height="50"><span class="gen">{L_NO_PICS}</span></td></tr>
	<!-- END no_pics -->
	<!-- BEGIN recent_pics -->
	<tr>
		<!-- BEGIN recent_col -->
		<td class="row1" width="{S_COL_WIDTH}" align="center" onMouseOver="this.className='row2';" onMouseOut="this.className='row1';">
			<table><tr><td><div class="picshadow"><div class="picframe">
				<a href="{recent_pics_block.recent_pics.recent_col.U_PIC}" {TARGET_BLANK}><img src="{recent_pics_block.recent_pics.recent_col.THUMBNAIL}" {THUMB_SIZE} border="0" alt="{recent_pics_block.recent_pics.recent_col.DESC}" title="{recent_pics_block.recent_pics.recent_col.DESC}" vspace="10" /></a>
			</div></div></td></tr></table>
		</td>
		<!-- END recent_col -->
	</tr>
	<tr>
		<!-- BEGIN recent_detail -->
		<td class="row2" align="center">
			<span class="gensmall">
				{L_POSTER}: {recent_pics_block.recent_pics.recent_detail.POSTER}<br />
				{L_PIC_TITLE}: {recent_pics_block.recent_pics.recent_detail.TITLE}<br />
				{L_PIC_ID}: {recent_pics_block.recent_pics.recent_detail.PIC_ID}<br />
				{L_POSTED}: {recent_pics_block.recent_pics.recent_detail.TIME}<br />
				{L_VIEW}: {recent_pics_block.recent_pics.recent_detail.VIEW}<br />
				{recent_pics_block.recent_pics.recent_detail.RATING}
				{recent_pics_block.recent_pics.recent_detail.COMMENTS}
				{recent_pics_block.recent_pics.recent_detail.IP}
			</span>
		</td>
		<!-- END recent_detail -->
	</tr>
	<!-- END recent_pics -->
</table>
<br />
<!-- END recent_pics_block -->

<!-- BEGIN highest_pics_block -->
<table class="forumline" width="98%" align="center" cellspacing="1" cellpadding="2">
	<tr><th height="25" colspan="{S_COLS}" nowrap="nowrap">{L_HI_RATINGS}</th></tr>
	<!-- BEGIN no_pics -->
	<tr>
		<td class="row1" align="center" colspan="{S_COLS}" height="50"><span class="gen">{L_NO_PICS}</span></td>
	</tr>
	<!-- END no_pics -->
	<!-- BEGIN highest_pics -->
	<tr>
		<!-- BEGIN highest_col -->
		<td class="row1" width="{S_COL_WIDTH}" align="center" onMouseOver="this.className='row2';" onMouseOut="this.className='row1';">
			<table><tr><td><div class="picshadow"><div class="picframe">
				<a href="{highest_pics_block.highest_pics.highest_col.U_PIC}" {TARGET_BLANK}><img src="{highest_pics_block.highest_pics.highest_col.THUMBNAIL}" {THUMB_SIZE} border="0" alt="{highest_pics_block.highest_pics.highest_col.DESC}" title="{highest_pics_block.highest_pics.highest_col.DESC}" vspace="10" /></a>
			</div></div></td></tr></table>
		</td>
		<!-- END highest_col -->
	</tr>
	<tr>
		<!-- BEGIN highest_detail -->
		<td class="row2" align="center">
			<span class="gensmall">
				{L_POSTER}: {highest_pics_block.highest_pics.highest_detail.H_POSTER}<br />
				{L_PIC_TITLE}: {highest_pics_block.highest_pics.highest_detail.H_TITLE}<br />
				{L_PIC_ID}: {highest_pics_block.highest_pics.highest_detail.PIC_ID}<br />
				{L_POSTED}: {highest_pics_block.highest_pics.highest_detail.H_TIME}<br />
				{L_VIEW}: {highest_pics_block.highest_pics.highest_detail.H_VIEW}<br />
				{highest_pics_block.highest_pics.highest_detail.H_RATING}
				{highest_pics_block.highest_pics.highest_detail.H_COMMENTS}
				{highest_pics_block.highest_pics.highest_detail.H_IP}
			</span>
		</td>
	<!-- END highest_detail -->
	</tr>
	<!-- END highest_pics -->
</table>
<br />
<!-- END highest_pics_block -->

<!-- BEGIN mostviewed_pics_block -->
<table class="forumline" width="98%" align="center" cellspacing="1" cellpadding="2">
	<tr><th class="thTop" height="25" colspan="{S_COLS}" nowrap="nowrap">{L_MOST_VIEWED}</th></tr>
	<!-- BEGIN no_pics -->
	<tr>
		<td class="row1" align="center" colspan="{S_COLS}" height="50"><span class="gen">{L_NO_PICS}</span></td>
	</tr>
	<!-- END no_pics -->
	<!-- BEGIN mostviewed_pics -->
	<tr>
	<!-- BEGIN mostviewed_col -->
		<td class="row1" width="{S_COL_WIDTH}" align="center" onMouseOver="this.className='row2';" onMouseOut="this.className='row1';">
			<table><tr><td><div class="picshadow"><div class="picframe">
				<a href="{mostviewed_pics_block.mostviewed_pics.mostviewed_col.U_PIC}" {TARGET_BLANK}><img src="{mostviewed_pics_block.mostviewed_pics.mostviewed_col.THUMBNAIL}" {THUMB_SIZE} border="0" alt="{mostviewed_pics_block.mostviewed_pics.mostviewed_col.DESC}" title="{mostviewed_pics_block.mostviewed_pics.mostviewed_col.DESC}" vspace="10" /></a>
			</div></div></td></tr></table>
		</td>
	<!-- END mostviewed_col -->
	</tr>
	<tr>
		<!-- BEGIN mostviewed_detail -->
		<td class="row2" align="center">
			<span class="gensmall">
				{L_POSTER}: {mostviewed_pics_block.mostviewed_pics.mostviewed_detail.H_POSTER}<br />
				{L_PIC_TITLE}: {mostviewed_pics_block.mostviewed_pics.mostviewed_detail.H_TITLE}<br />
				{L_PIC_ID}: {mostviewed_pics_block.mostviewed_pics.mostviewed_detail.PIC_ID}<br />
				{L_POSTED}: {mostviewed_pics_block.mostviewed_pics.mostviewed_detail.H_TIME}<br />
				{L_VIEW}: {mostviewed_pics_block.mostviewed_pics.mostviewed_detail.H_VIEW}<br />
				{mostviewed_pics_block.mostviewed_pics.mostviewed_detail.H_RATING}
				{mostviewed_pics_block.mostviewed_pics.mostviewed_detail.H_COMMENTS}
				{mostviewed_pics_block.mostviewed_pics.mostviewed_detail.H_IP}
			</span>
		</td>
		<!-- END mostviewed_detail -->
	</tr>
	<!-- END mostviewed_pics -->
</table>
<br />
<!-- END mostviewed_pics_block -->

<!-- BEGIN random_pics_block -->
<table class="forumline" width="98%" align="center" cellspacing="1" cellpadding="2">
	<tr><th class="thTop" height="25" colspan="{S_COLS}" nowrap="nowrap">{L_RAND_PICS}</th></tr>
	<!-- BEGIN no_pics -->
	<tr>
		<td class="row1" align="center" colspan="{S_COLS}" height="50"><span class="gen">{L_NO_PICS}</span></td>
	</tr>
	<!-- END no_pics -->
	<!-- BEGIN rand_pics -->
	<tr>
		<!-- BEGIN rand_col -->
		<td class="row1" width="{S_COL_WIDTH}" align="center" onMouseOver="this.className='row2';" onMouseOut="this.className='row1';">
			<table><tr><td><div class="picshadow"><div class="picframe">
				<a href="{random_pics_block.rand_pics.rand_col.U_PIC}" {TARGET_BLANK}><img src="{random_pics_block.rand_pics.rand_col.THUMBNAIL}" {THUMB_SIZE} border="0" alt="{random_pics_block.rand_pics.rand_col.DESC}" title="{random_pics_block.rand_pics.rand_col.DESC}" vspace="10" /></a>
			</div></div></td></tr></table>
		</td>
		<!-- END rand_col -->
	</tr>
	<tr>
		<!-- BEGIN rand_detail -->
		<td class="row2" align="center">
			<span class="gensmall">
				{L_POSTER}: {random_pics_block.rand_pics.rand_detail.POSTER}<br />
				{L_PIC_TITLE}: {random_pics_block.rand_pics.rand_detail.TITLE}<br />
				{L_PIC_ID}: {random_pics_block.rand_pics.rand_detail.PIC_ID}<br />
				{L_POSTED}: {random_pics_block.rand_pics.rand_detail.TIME}<br />
				{L_VIEW}: {random_pics_block.rand_pics.rand_detail.VIEW}<br />
				{random_pics_block.rand_pics.rand_detail.RATING}
				{random_pics_block.rand_pics.rand_detail.COMMENTS}
				{random_pics_block.rand_pics.rand_detail.IP}
			</span>
		</td>
		<!-- END rand_detail -->
	</tr>
	<!-- END rand_pics -->
</table>
<br />
<!-- END random_pics_block -->
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM